using System;
using System.Collections.Generic;
using UnityEngine;

[Serializable]
public class GameSession
{
	public int currentMapID;

	public int sessionCount;

	public List<int> availableMapIDs;

	public GameSession()
	{
		availableMapIDs = new List<int>();
	}

	public void ResetSessionData(Map[] pool)
	{
		foreach (Map map in pool)
		{
			availableMapIDs.Add(map.id);
		}
		int num = availableMapIDs.Count;
		while (num > 1)
		{
			num--;
			int index = UnityEngine.Random.Range(0, availableMapIDs.Count);
			int value = availableMapIDs[index];
			availableMapIDs[index] = availableMapIDs[num];
			availableMapIDs[num] = value;
		}
		currentMapID = GetNextMap();
		sessionCount = 0;
	}

	public void NextSession()
	{
		sessionCount++;
		currentMapID = GetNextMap();
	}

	private int GetNextMap()
	{
		int num = availableMapIDs[0];
		availableMapIDs.Remove(num);
		availableMapIDs.Add(num);
		return num;
	}
}
